package com.kede.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 置换物品品类表
 * @TableName t_zhi_category
 */
@TableName(value ="t_zhi_category")
@Data
public class ZhiCategoryDomain implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 
     */
    @TableField(value = "pid")
    private Integer pid;

    /**
     * 品类名称
     */
    @TableField(value = "`name`")
    private String name;

    /**
     * 默认用户价格
     */
    @TableField(value = "default_user_money")
    private BigDecimal defaultUserMoney;

    /**
     * 默认用户德币
     */
    @TableField(value = "default_user_debi")
    private BigDecimal defaultUserDebi;

    /**
     * 默认门店价格
     */
    @TableField(value = "default_store_money")
    private BigDecimal defaultStoreMoney;

    /**
     * 默认区代价格
     */
    @TableField(value = "default_qu_money")
    private BigDecimal defaultQuMoney;

    /**
     * 默认市代价格
     */
    @TableField(value = "default_shi_money")
    private BigDecimal defaultShiMoney;

    /**
     * 
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    @TableField(value = "is_weight")
    private Integer isWeight;

    /**
     * 
     */
    @TableField(value = "create_by")
    private String createBy;

    /**
     * 
     */
    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 所属组
     */
    @TableField(value = "`group`")
    private String group;

    /**
     * 是否启用状态  1启用  2禁用
     */
    @TableField(value = "is_active")
    private Integer isActive;

    /**
     * 是否热门
     */
    @TableField(value = "is_hot")
    private Integer isHot;

    /**
     * 热门图标
     */
    @TableField(value = "hot_url")
    private String hotUrl;

    @TableField(exist = false)
    private ZhiImgsDomain imgs;

    @TableField(exist = false)
    private List<ZhiActionDomain> zhiActionList;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ZhiCategoryDomain other = (ZhiCategoryDomain) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPid() == null ? other.getPid() == null : this.getPid().equals(other.getPid()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getDefaultUserMoney() == null ? other.getDefaultUserMoney() == null : this.getDefaultUserMoney().equals(other.getDefaultUserMoney()))
            && (this.getDefaultStoreMoney() == null ? other.getDefaultStoreMoney() == null : this.getDefaultStoreMoney().equals(other.getDefaultStoreMoney()))
            && (this.getDefaultQuMoney() == null ? other.getDefaultQuMoney() == null : this.getDefaultQuMoney().equals(other.getDefaultQuMoney()))
            && (this.getDefaultShiMoney() == null ? other.getDefaultShiMoney() == null : this.getDefaultShiMoney().equals(other.getDefaultShiMoney()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getGroup() == null ? other.getGroup() == null : this.getGroup().equals(other.getGroup()))
            && (this.getIsActive() == null ? other.getIsActive() == null : this.getIsActive().equals(other.getIsActive()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPid() == null) ? 0 : getPid().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getDefaultUserMoney() == null) ? 0 : getDefaultUserMoney().hashCode());
        result = prime * result + ((getDefaultStoreMoney() == null) ? 0 : getDefaultStoreMoney().hashCode());
        result = prime * result + ((getDefaultQuMoney() == null) ? 0 : getDefaultQuMoney().hashCode());
        result = prime * result + ((getDefaultShiMoney() == null) ? 0 : getDefaultShiMoney().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getGroup() == null) ? 0 : getGroup().hashCode());
        result = prime * result + ((getIsActive() == null) ? 0 : getIsActive().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", pid=").append(pid);
        sb.append(", name=").append(name);
        sb.append(", defaultUserMoney=").append(defaultUserMoney);
        sb.append(", defaultStoreMoney=").append(defaultStoreMoney);
        sb.append(", defaultQuMoney=").append(defaultQuMoney);
        sb.append(", defaultShiMoney=").append(defaultShiMoney);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", createBy=").append(createBy);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", group=").append(group);
        sb.append(", isActive=").append(isActive);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}